<template>
  <div class="bg">
    <div class="header">
      <img src="../img/head.svg">
      <div class="box">
        <div class="title" style="cursor: pointer;" @click="goHome">数智化控制中心</div>
      </div>
    </div>

    <div class="dp_con">
      <div class="left v2">
        <div style="height: 60%;">
          <img class="ydtj_t1" src="../img/p14.png">
        </div>
        <div class="flex p-8" style="height: 40%">
          <div class="w-100">
            <div class="card" style="height: 100%">
              <div class="title">
                <img class="icon1" src="../img/icon1.svg">
                <span>用电趋势</span>
                <img class="icon2" src="../img/icon2.svg">
              </div>
              <div class="body">
                <div class="zw" style="height: 100%" ref="ydqsChar"></div>
              </div>
            </div>
          </div>
          <div class="w-100">
            <div class="card" style="height: 100%">
              <div class="title">
                <img class="icon1" src="../img/icon1.svg">
                <span>单位能耗(度/吨)</span>
                <img class="icon2" src="../img/icon2.svg">
              </div>
              <div class="body">
                <div class="zw" style="height: 100%" ref="dynhChar"></div>
              </div>
            </div>
          </div>

        </div>
      </div>
      <div class="right v2">
        <div class="card">
          <div class="title">
            <img class="icon1" src="../img/icon1.svg">
            <span>用电统计(度)</span>
            <img class="icon2" src="../img/icon2.svg">
          </div>
          <div class="body">
            <div class="ydtj_t2">
              <div class="item">
                <p class="text1">{{yd_thisDay}}</p>
                <p class="text2">今日用电</p>
              </div>
              <div class="item">
                <p class="text1">{{yd_thisMonth}}</p>
                <p class="text2">今月用电</p>
              </div>
              <div class="item">
                <p class="text1">{{yd_thisYear}}</p>
                <p class="text2">全年用电</p>
              </div>

              <div class="item">
                <p class="text1">{{yd_pastDay}}</p>
                <p class="text2">近1天用电</p>
              </div>
              <div class="item">
                <p class="text1">{{yd_pastMonth}}</p>
                <p class="text2">近1月用电</p>
              </div>
              <div class="item">
                <p class="text1">{{yd_pastYear}}</p>
                <p class="text2">近1年用电</p>
              </div>
            </div>
          </div>
        </div>
        <div class="card ydtj_h">
          <div class="title">
            <img class="icon1" src="../img/icon1.svg">
            <span>月同比分析(度)</span>
            <img class="icon2" src="../img/icon2.svg">
          </div>
          <div class="body">
            <div class="flex p-8" style="height: 100%">
              <div class="w-100">
                <div class="zw" style="height: 100%" ref="tbfxChar"></div>
              </div>
            </div>

          </div>
        </div>
        <div class="card ydtj_h">
          <div class="title">
            <img class="icon1" src="../img/icon1.svg">
            <span>月环比分析(度)</span>
            <img class="icon2" src="../img/icon2.svg">
          </div>
          <div class="body">
            <div class="flex p-8" style="height: 100%">
              <div class="w-100">
                <div class="zw" style="height: 100%" ref="hbfxChar"></div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="footer">
      <img src="../img/footer.svg">
    </div>
  </div>
</template>

<script>
import {initTheme} from '@/components/SettingDrawer/settingConfig'
import defaultSettings from '@/config/defaultSettings'
import {SysMixin} from '@/mixins/SysMixin'

import * as echarts from 'echarts'
import {
  iss_event_stat_window,
  manufactureSummary,
  iss_event_stat_type,
  ems_electric_summary,
  ems_electric_history,
  dpm_oee,ems_dongqing_electric_perProduct
} from '@/views/kzzx/utils/api'
import {
  getNowDaySTTime,
  getNowMonthSTTime,
  getNowYearSTTime,
  getMonthStartEnd,
  getMonthAgoToNowSTTime,
  getDecimalPlaces,
  getDaysAgo,
  getMonthAgo,
  formatDateTime, formatMonth, formatDate, getDaysInMonth, getYearAgo, getMonthAgoNew, getMonthAgoDate

} from '@/views/kzzx/utils/util'
import constant from '@/views/kzzx/utils/constant'
import Big from 'big.js'

export default {
  name: 'nh',
  components: {},
  mixins:[SysMixin],
  beforeCreate () {

  },

  beforeDestroy () {
    if(this.timmer){
      console.log("清除定时器")
      clearTimeout(this.timmer)
    }
  },

  data () {
    return {
      visible:false,
      ydqsState:{
        ydqs_day:false,
        ydqs_month:true,
        ydqs_year:false,
      },
      //单位能耗
      dwnhState:{
        dynh_day:false,
        dynh_month:true,
        dynh_year:false,
      },

      //用电趋势
      ydqsChar:null,

      //单位能耗
      dynhChar:null,

      //同比分析
      tbfxChar:null,


      //环比分析左侧
      hbfxChar:null,


      //当天用电
      yd_thisDay:0,
      //当月用电
      yd_thisMonth:0,
      //当年用电
      yd_thisYear:0,
      //近一天用电
      yd_pastDay:0,
      //近一月用电
      yd_pastMonth:0,
      //近一年用电
      yd_pastYear:0,

      //定时器
      timmer:null,

      //间隔
      interval:1000*60*10
    }
  },
  // 监听属性
  computed: {

  },
  created () {

  },
  mounted () {
    document.title = "能耗统计"
    let that = this
    this.initTheme()
    that.$nextTick(() => {
      //初始化图表
      that.initChar()

      that.query()

      //同比分析
      // that.setTbfxChar()

      //同比分析
      that.setHbfxChar()

    })
  },
  destroy () {

  },
  methods: {
    showModal() {
      this.visible = true;
    },
    initTheme(){
      let theme = localStorage.getItem(defaultSettings.localStorageThemeKey)
      initTheme(theme || defaultSettings.primaryTheme)
    },

    handleOk(e) {

      this.visible = false;

    },
    handleCancel(e) {
      this.visible = false;
    },

    initChar () {
      this.ydqsChar = echarts.init(this.$refs.ydqsChar)
      this.dynhChar = echarts.init(this.$refs.dynhChar)
      this.tbfxChar = echarts.init(this.$refs.tbfxChar)
      this.hbfxChar = echarts.init(this.$refs.hbfxChar)
    },

    query(){
      //用电统计
      this.queryYdtj()

      //用电趋势
      this.queryYdQsMonth()

      //单位能耗
      this.queryPerProduct();

      //同比
      this.queryTb()

      //环比
      this.queryHb()

      if(this.timmer){
        clearTimeout(this.timmer)
      }
      this.timmer = setTimeout(() => {
        this.query()
      }, this.interval)
    },

    /**
     * 查询用电统计
     */
    queryYdtj(){
      ems_electric_summary().then(res=>{
        if(constant.successCode===res.code){
          console.log("接口:/api/ems/electric/summary","方法:ems_electric_summary",res)
          let data = res.data
          this.yd_thisDay=data.thisDay
          this.yd_thisMonth = data.thisMonth
          this.yd_thisYear = data.thisYear

          this.yd_pastDay = data.pastDay
          this.yd_pastMonth = data.pastMonth
          this.yd_pastYear = data.pastYear
        }
      })
    },

    /**
     * 查询最近12个月，每个月用电
     */
    queryYdQsMonth(){
      let m = getMonthAgo(11)
      ems_electric_history(m+"-01 00:00:00",formatDateTime(new Date()),constant.win_group,constant.winUnit_mo).then(res=>{
        console.log("接口：/api/ems/electric/history","方法：ems_electric_history",res)
        if(constant.successCode===res.code){
          let source = res.data.source
          let xAxisData = []
          let seriesData = []
          for(const item of source){
            xAxisData.push(formatMonth(new Date(item[0])))
            seriesData.push(item[1])
          }
          this.setYdqsChar(xAxisData,seriesData)
        }
      })
    },

    /**
     * 查询单位能耗
     */
    queryPerProduct(){
      let m = getMonthAgo(11)
      ems_dongqing_electric_perProduct(m+"-01 00:00:00",formatDateTime(new Date()),constant.win_group,constant.winUnit_mo).then(res=>{
        console.log("接口：/api/ems/dongqing/electric/perProduct","方法：ems_dongqing_electric_perProduct",res)
        if(constant.successCode===res.code){
          let source = res.data.source
          let xAxisData = []
          let seriesData = []
          for(const item of source){
            xAxisData.push(formatDate(new Date(item[0])))
            seriesData.push(item[1])
          }
          this.setDynhChar(xAxisData,seriesData)
        }
      })
    },

    /**
     * 查询历史用电数据
     */
    async queryElectricHistory(st,et){
      return await ems_electric_history(st,et,constant.win_group,constant.winUnit_mo).then(res=>{
        return res
      })
    },
    /**
     * 同比
     */
    async queryTb(){
      //近24个月之间的比
      let tqst = formatMonth(getMonthAgoDate(11))
      let tqet = formatMonth(new Date())

      let tongqi_st = tqst+"-01 00:00:00"
      let tongqi_et = tqet
      let tongqi_days = getDaysInMonth(tongqi_et)
      tongqi_et = tongqi_et+"-"+tongqi_days+" 23:59:59"

      let wqst = getMonthAgo(23)
      // let wqet = getMonthAgo(11)
      let wqet = getYearAgo(1)

      let wangqi_st = wqst+"-01 00:00:00"
      let wangqi_et = wqet
      let wangqi_days = getDaysInMonth(wangqi_et)
      wangqi_et = wangqi_et+"-"+wangqi_days+" 23:59:59"


      let tongqiData = []
      let xAxisData=[]
      let wangqiData=[]
      let zengzhagnlv=[]

      let tongqiRes = await this.queryElectricHistory(tongqi_st,tongqi_et)
      let wangqiRes = await this.queryElectricHistory(wangqi_st,wangqi_et)
      if(constant.successCode===tongqiRes.code && constant.successCode===wangqiRes.code){
        let tongqiSource = tongqiRes.data.source
        for(const item of tongqiSource){
          let m = (formatMonth(new Date(item[0])))
          xAxisData.push(m)
          if(!item[1] || item[1]==null){
            item[1]=0
          }
          tongqiData.push(item[1])
        }



        let wangqiSource = wangqiRes.data.source
        for(const item of wangqiSource){
          if(!item[1] || item[1]==null){
            item[1]=0
          }
          wangqiData.push(item[1])

          //模拟数据
          // wangqiData.push(Math.floor(Math.random() * (10000 - 1000 + 1)) + 1000)
        }

        for(let i=0;i<tongqiData.length;i++){
          let zzl = 0
          if(wangqiData[i]!==0){
            //(本期数值 - 上期数值) / 上期数值 × 100%
            zzl = (Big(tongqiData[i]).minus(wangqiData[i])).div(wangqiData[i]).times(100).toFixed(2).toString()
            console.log(zzl)
          }
          zengzhagnlv.push(zzl)
        }
        console.log(tongqiData,wangqiData,xAxisData,zengzhagnlv)

        this.setTbfxChar(tongqiData,wangqiData,xAxisData,zengzhagnlv,tqst,tqet,wqst,wqet)
      }



    },

    /**
     * 环比
     */
    async queryHb(){
      //近24个月之间的比
      let tqst = formatMonth(getMonthAgoDate(11))
      let tqet = formatMonth(new Date())

      let tongqi_st = tqst+"-01 00:00:00"
      let tongqi_et = tqet
      let tongqi_days = getDaysInMonth(tongqi_et)
      tongqi_et = tongqi_et+"-"+tongqi_days+" 23:59:59"

      let wqst = formatMonth(getMonthAgoDate(12))
      let wqet = formatMonth(getMonthAgoDate(1))

      let wangqi_st = wqst+"-01 00:00:00"
      let wangqi_et = wqet
      let wangqi_days = getDaysInMonth(wangqi_et)
      wangqi_et = wangqi_et+"-"+wangqi_days+" 23:59:59"

      console.log(tongqi_st,tongqi_et,wangqi_st,wangqi_et)


      let tongqiData = []
      let xAxisData=[]
      let wangqiData=[]
      let zengzhagnlv=[]
      let tongqiRes = await this.queryElectricHistory(tongqi_st,tongqi_et)
      let wangqiRes = await this.queryElectricHistory(wangqi_st,wangqi_et)

      if(constant.successCode===tongqiRes.code && constant.successCode===wangqiRes.code) {
        let tongqiSource = tongqiRes.data.source
        for (const item of tongqiSource) {
          let m = (formatMonth(new Date(item[0])))
          xAxisData.push(m)
          if (!item[1] || item[1] == null) {
            item[1] = 0
          }
          tongqiData.push(item[1])
        }

        let wangqiSource = wangqiRes.data.source
        for (const item of wangqiSource) {
          let m = (formatMonth(new Date(item[0])))
          if (!item[1] || item[1] == null) {
            item[1] = 0
          }
          wangqiData.push(item[1])

          //模拟数据
          // wangqiData.push(Math.floor(Math.random() * (10000 - 1000 + 1)) + 1000)
        }

        for (let i = 0; i < tongqiData.length; i++) {
          let zzl = 0
          if (wangqiData[i] !== 0) {
            //(本期数值 - 上期数值) / 上期数值 × 100%
            zzl = (Big(tongqiData[i]).minus(wangqiData[i])).div(wangqiData[i]).times(100).toFixed(2).toString()
            console.log(zzl)
          }
          zengzhagnlv.push(zzl)
        }
        console.log(tongqiData, wangqiData, xAxisData, zengzhagnlv)

        this.setHbfxChar(tongqiData, wangqiData, xAxisData, zengzhagnlv, tqst, tqet, wqst, wqet)
      }



    },

    //用电趋势图
    setYdqsChar(xAxisData,seriesData){
      let option = {
        grid: {
          top: '12%',
          bottom:'12%'
        },
        tooltip: {
          trigger: 'axis',
          axisPointer: {
            type: 'shadow',
            crossStyle: {
              color: '#999'
            }
          }
        },
        xAxis: {
          type: 'category',
          data: xAxisData,
          axisPointer: { type: 'shadow' },
          axisLine: { lineStyle: { color: '#ffffff' } }
        },
        yAxis: {
          type: 'value',
          axisLine: { lineStyle: { color: '#ffffff' } },
          splitLine: {
            lineStyle: {
              color: '#318BAB', // 设置线的颜色为蓝色
              width: 2,         // 设置线的宽度
              type: 'dashed'     // 设置线的类型为实线
            }
          }
        },
        dataZoom: [{
          height:15,
          type: 'slider', // 内部滚动条
          start: 0,       // 初始滚动位置
          end: 100,         // 初始显示的部分（0% 到 50%）
          show:true,        // 初始显示的部分（0% 到 50%）
          bottom:0
        }],
        series: [
          {
            data: seriesData,
            type: 'line'
          }
        ]
      }
      this.ydqsChar.setOption(option)
    },

    //单位能耗图
    setDynhChar(xAxisData,seriesData){
      let option = {
        grid: {
          top: '12%',
          bottom:'12%'
        },
        tooltip: {
          trigger: 'axis',
          axisPointer: {
            type: 'shadow',
            crossStyle: {
              color: '#999'
            }
          }
        },
        xAxis: {
          type: 'category',
          data: xAxisData,
          axisPointer: { type: 'shadow' },
          axisLine: { lineStyle: { color: '#ffffff' } }
        },
        yAxis: {
          type: 'value',
          axisLine: { lineStyle: { color: '#ffffff' } },
          splitLine: {
            lineStyle: {
              color: '#318BAB', // 设置线的颜色为蓝色
              width: 2,         // 设置线的宽度
              type: 'dashed'     // 设置线的类型为实线
            }
          }
        },
        dataZoom: [{
          height:15,
          type: 'slider', // 内部滚动条
          start: 0,       // 初始滚动位置
          end: 100,         // 初始显示的部分（0% 到 50%）
          show:true,        // 初始显示的部分（0% 到 50%）
          bottom:0
        }],
        series: [
          {
            data: seriesData,
            type: 'line',
            itemStyle:{
              color:'#36F363'
            }
          }
        ]
      }
      this.dynhChar.setOption(option)
    },

    //同比分析
    setTbfxChar (tongqiData,wangqiData,xAxisData,zengzhagnlv,tqst,tqet,wqst,wqet) {
      let option = {
        grid:{
          top:'12%',
          bottom:'12%',
          left:'12%'
        },
        tooltip: {
          trigger: 'axis',
          axisPointer: {
            type: 'shadow',
            crossStyle: {
              color: '#999'
            }
          }
        },
        legend: {
          data: ['本期('+tqst+'~'+tqet+')', '同期('+wqst+'~'+wqet+')','增长率'],
          textStyle: { color: '#ffffff' }
        },
        xAxis: [
          {
            type: 'category',
            data: xAxisData,
            axisPointer: { type: 'shadow' },
            axisLine: { lineStyle: { color: '#ffffff' } }
          }
        ],
        yAxis: [
          {
            type: 'value',
            axisLabel: { formatter: '{value}' },
            axisLine: { lineStyle: { color: '#ffffff', width: 1, type: 'dashed' } },
            splitLine: {
              lineStyle: {
                color: '#318BAB', // 设置线的颜色为蓝色
                width: 2,         // 设置线的宽度
                type: 'dashed'     // 设置线的类型为实线
              }
            }
          },
          {
            axisLine: {
              show: false, lineStyle: { color: '#ffffff' }
            },
            splitLine: {
              show: false
            }
          }
        ],
        /*
        dataZoom: [{
          height:15,
          type: 'slider', // 内部滚动条
          start: 0,       // 初始滚动位置
          end: 100,         // 初始显示的部分（0% 到 50%）
          show:true,        // 初始显示的部分（0% 到 50%）
          bottom:0
        }],
        */
        series: [
          {
            name: '本期('+tqst+'~'+tqet+')',
            type: 'bar',
            tooltip: {
              valueFormatter: function (value) {
                return value
              }
            },

            data: tongqiData
          },

          {
            name: '同期('+wqst+'~'+wqet+')',
            type: 'bar',
            tooltip: {
              valueFormatter: function (value) {
                return value
              }
            },

            data: wangqiData
          },

          {
            name: '增长率',
            type: 'line',
            yAxisIndex: 1,
            tooltip: {
              valueFormatter: function (value) {
                return value
              }
            },
            itemStyle:{
              color:'#CFD90C'
            },
            data: zengzhagnlv
          },

        ]
      }
      this.tbfxChar.setOption(option)
    },

    //环比分析
    setHbfxChar (tongqiData, wangqiData, xAxisData, zengzhagnlv, tqst, tqet, wqst, wqet) {
      let option = {
        grid:{
          top:'12%',
          bottom:'12%',
          left:'12%'
        },
        tooltip: {
          trigger: 'axis',
          axisPointer: {
            type: 'shadow',
            crossStyle: {
              color: '#999'
            }
          }
        },
        legend: {
          data: ['本期('+tqst+'~'+tqet+')', '上期('+wqst+'~'+wqet+')','增长率'],
          textStyle: { color: '#ffffff' }
        },
        xAxis: [
          {
            type: 'category',
            data: xAxisData,
            axisPointer: { type: 'shadow' },
            axisLine: { lineStyle: { color: '#ffffff' } }
          }
        ],
        yAxis: [
          {
            type: 'value',
            axisLabel: { formatter: '{value}' },
            axisLine: { lineStyle: { color: '#ffffff', width: 1, type: 'dashed' } },
            splitLine: {
              lineStyle: {
                color: '#318BAB', // 设置线的颜色为蓝色
                width: 2,         // 设置线的宽度
                type: 'dashed'     // 设置线的类型为实线
              }
            }
          },
          {
            axisLine: {
              show: false, lineStyle: { color: '#ffffff' }
            },
            splitLine: {
              show: false
            }
          }
        ],
        /*
        dataZoom: [{
          height:15,
          type: 'slider', // 内部滚动条
          start: 0,       // 初始滚动位置
          end: 100,         // 初始显示的部分（0% 到 50%）
          show:true,        // 初始显示的部分（0% 到 50%）
          bottom:0
        }],
         */
        series: [
          {
            name: '本期('+tqst+'~'+tqet+')',
            type: 'bar',
            tooltip: {
              valueFormatter: function (value) {
                return value
              }
            },

            data: tongqiData
          },

          {
            name: '上期('+wqst+'~'+wqet+')',
            type: 'bar',
            tooltip: {
              valueFormatter: function (value) {
                return value
              }
            },
            itemStyle:{
              color:'#752AEE'
            },
            data: wangqiData
          },

          {
            name: '增长率',
            type: 'line',
            yAxisIndex: 1,
            tooltip: {
              valueFormatter: function (value) {
                return value
              }
            },
            itemStyle:{
              color:'#50B293'
            },
            data: zengzhagnlv
          },

        ]
      }
      this.hbfxChar.setOption(option)
    },

    goHome(){
      this.$router.push('/home')
      // window.location.href = constant.homeUrl
    }
  }

}
</script>

<style lang="less" scoped>

body {
  font-family: 'myriad-pro', 'Arial' !important;
  margin: 0;
  padding: 0;
}

.w-100 {
  width: 100%;
}

.flex {
  display: flex;
}

.flex-0 {
  flex: 0 0 auto;
}

.flex_c_c {
  display: flex;
  align-items: center;
  justify-content: center;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: 100%;
  margin: auto;
  max-width: 68.750vw;
}

ul, li, p {
  margin: 0;
  padding: 0;
  list-style: none;
}


.header {
  position: relative;
  box-sizing: content-box;
  height: 6.875vw;

  > img {
    width: 100%;
  }

  .box {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 99;

    .title {
      font-size: 2.188vw;
      font-weight: bold;
      text-align: center;
      margin-top: 2.240vw;
      text-shadow: 0 0.208vw 0.208vw rgba(0, 0, 0, 0.25);
      background: linear-gradient(180deg, #FFFFFF 0%, #83C3EF 83%, #0184DE 100%);
      -webkit-background-clip: text;
      background-clip: text;
      color: transparent;
    }

  }
}


.bg {
  min-height: 100vh;
  margin: 0;
  padding: 0;
  font-size: 0.729vw;
  line-height: 1;
  background-image: url('../img/bg.png');
  background-repeat: no-repeat;
  background-position: top;
  background-size: cover;
  color: #fff;

}


.dp_con {
  position: relative;
  //background-image: url("../img/line2.svg");
  background-size: 97.6%;
  height: calc(100vh - 6.354vw);
  background-repeat: no-repeat;
  background-position: center bottom;
  padding: 0 0.833vw;
  display: flex;
  margin-top: -2.083vw;


  .left {
    width: 26.302vw;
    flex: 0 0 auto;
  }

  .right {
    width: 26.302vw;
    flex: 0 0 auto;
  }

  .center {
    width: 100%;
    padding: 0 0.833vw;
  }
}

.card {
  margin-bottom: 0.625vw;
  text-align: left;
  background: rgba(10, 63, 152, 0.2);
  position: relative;
  padding: 0.417vw;
  box-sizing: border-box;

  .title {
    display: flex;
    align-items: center;
    background-size: 100%;
    background-position: bottom;
    padding-bottom: 0.521vw;
    font-size: 0.938vw;
    font-weight: bold;
    margin-bottom: 0.313vw;
    background-repeat: no-repeat;
    text-shadow: 0 0 0.521vw #00b6ff;
    position: relative;

    &::before {
      content: "";
      position: absolute;
      bottom: 0;
      left: 0;
      width: 3.385vw;
      height: 0.156vw;
      background: #0086FF;
    }

    &::after {
      content: "";
      position: absolute;
      bottom: 0;
      left: 3.646vw;
      right: 2.604vw;
      height: 0.156vw;
      background: #083566;
    }

    .icon1 {
      margin-right: 0.625vw;
      width: 0.781vw;
    }

    .icon2 {
      position: absolute;
      width: 2.500vw;
      bottom: 0;
      right: 0;
    }
  }

  .body {
    position: relative;
    padding: 0.417vw;
    box-sizing: border-box;
    height: calc(100% - 2.396vw);

    > .img {
      position: absolute;
      width: 0.521vw;

      &.t1 {
        left: 0;
        top: 0;
      }

      &.t2 {
        right: 0;
        top: 0;
        transform: rotate(90deg);
      }

      &.t3 {
        left: 0;
        bottom: 0;
        transform: rotate(270deg);
      }

      &.t4 {
        right: 0;
        bottom: 0;
        transform: rotate(180deg);
      }
    }

  }
}

.height_50 {
  height: calc(50% - 0.625vw)
}

.height_3 {
  height: calc(33.33% - 0.625vw)
}

.height_6 {
  height: calc(66.66% - 0.625vw)
}

/* 整个滚动条 */
::-webkit-scrollbar {
  width: 0.313vw; /* 滚动条宽度 */
}

/* 滚动条轨道 */
::-webkit-scrollbar-track {
  background: rgba(241, 241, 241, 0); /* 轨道背景色 */
  border-radius: 0.313vw;
}

/* 滚动条滑块 */
::-webkit-scrollbar-thumb {
  background: #9dbfd2; /* 滑块背景色 */
  border-radius: 0.313vw;
}

/* 滚动条滑块悬停状态 */
::-webkit-scrollbar-thumb:hover {
  background: #555; /* 滑块悬停时的背景色 */
}


.footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;

  img {
    display: block;
    margin: auto;
    width: 70.729vw;
  }
}

.sckg {
  display: flex;
  justify-content: space-between;

  .item {
    width: 4.688vw;
    text-align: center;

    img {
      width: 100%;
      display: block;
    }

    .text1 {
      position: relative;
      top: -2.604vw;
      font-weight: bold;
      font-size: 1.458vw;
      color: #FFFFFF;
      line-height: 1;
      background: linear-gradient(180deg, #FFFFFF 0%, #55D0FF 100%);
      -webkit-background-clip: text;
      background-clip: text;
      color: transparent;
      margin-top: -0.781vw;
    }

    .text2 {
      font-size: 0.625vw;
    }
  }
}

.sckg_tb {
  height: calc(100% - 6.458vw);
  margin-top: 0.625vw;
}

.sbxj {
  display: flex;
  justify-content: space-between;

  .item {
    flex: 1;
    text-align: center;

    img {
      width: 3.646vw;
    }

    .text1 {
      font-size: 0.573vw;
      margin: 0.521vw 0;
    }

    .text2 {
      font-size: 1.042vw;

      small {
        font-size: 0.677vw;
      }
    }
  }
}

.sbxj_tb {
  height: calc(100% - 7.813vw);
  margin-top: 0.625vw;
}


.znaf_tb {
  display: flex;
  height: 100%;
}

.ydtj {
  display: flex;

  .icon1 {
    width: 5.729vw;
    margin: 1.042vw 1.302vw 0 0.625vw;
  }

  .item {
    position: relative;
    font-size: 0.729vw;
    margin-bottom: 0.625vw;

    img {
      width: 100%;
      display: block;
    }

    .text1 {
    }

    .text2 {
      font-size: 1.250vw;
      font-weight: bold;
      position: relative;
      top: -0.052vw;
    }

    .text3 {
      margin-left: 0.625vw;
    }

    .info {
      position: absolute;
      left: 1.354vw;
      right: 0.729vw;
      top: 0;
      bottom: 0;
      display: flex;
      align-items: center;
    }
  }
}

.ydtj_tb {
  height: calc(100% - 8.125vw);
}

.sbjx {
  display: flex;
  justify-content: space-around;

  .item {
    text-align: center;
    flex: 1;

    div {
      height: 5.208vw;
    }

    p {
      margin-top: 0.625vw;
    }
    &.v2{
      div{
        height: 6.771vw
      }
    }
  }
}


.sbjx_tb {
  height: calc(100% - 7.292vw);
  margin-top: 0.625vw;

}

.zw {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
}

.sblyl {
  height: 100%;
}


.sbxj_tb {
  height: calc(100% - 8.594vw);
  margin-top: 0.625vw;
}


.xnzb_c {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-around;
  flex-direction: column;

  .r1 {
    width: 21.354vw;

    .item {
      margin: 2.083vw 0;
    }

    .line {
      height: 0.156vw;
      background: rgba(255, 255, 255, 0.28);
      display: flex;
      justify-content: space-between;
      align-items: center;

      &::before, &::after {
        content: "";
        width: 1.146vw;
        height: 0.156vw;
        background: #FED9A6;
        box-shadow: 0 0 0.313vw 0 #FED9A6;
      }
    }

    .box {
      margin: 0.417vw 0;
      background: #003E59;
      border: 0.052vw solid #00F9FF;
      height: 4.167vw;
      display: flex;
      align-items: center;
      padding: 0 1.250vw 0 0;
      box-sizing: border-box;

      img {
        width: 4.167vw;
        height: 4.167vw;
        margin-right: 0.625vw;
      }

      .text1 {
        font-size: 0.885vw;
      }

      .text2 {
        font-size: 0.729vw;
        margin-top: 0.625vw;
      }

      .text3 {
        font-size: 1.667vw;
        color: #12E4F5;
        font-weight: bold;
      }

      &.v2 {
        background: #0B2248;
        border: 0.052vw solid #2F6EDD;

        .text3 {
          color: #2F6EDD;
        }
      }
    }
  }

  .r2 {
    position: relative;

    .bg2 {
      width: 26.823vw;
      display: block;
      padding: 2.083vw 2.083vw 0 2.083vw;
      box-sizing: border-box;
    }

    .item {
      text-align: center;
      position: absolute;
      z-index: 1;
      top: 0;
      left: 0;

      .text1 {
        width: 3.333vw;
        height: 3.333vw;
        text-align: center;
        line-height: 3.333vw;
        background-image: url("../img/icon7.svg");
        border-radius: 100%;
        margin: auto;
        font-size: 1.042vw;
      }

      .text2 {
        margin-top: 0.417vw;
      }

      &:nth-child(1) {
        top: 35%;
      }

      &:nth-child(2) {
        top: 0;
        left: 13%;
      }

      &:nth-child(3) {
        top: 0;
        left: 75%;
      }

      &:nth-child(4) {
        top: 38%;
        left: 87%;
      }
    }
  }
}


.scgl-title {
  text-align: center;
  margin-bottom: 0.625vw;
}

.scgl_t1 {
  display: flex;
  flex-wrap: wrap;

  .item {
    width: 50%;
    height: 50%;
    padding: 0.625vw 0;
    box-sizing: border-box;
    display: flex;

    .flex-0 {
      height: 100%;
      width: 50%;
    }

    .flex_c_c {
      justify-content: flex-start;
      padding-left: 0.625vw;
    }
  }
}

.scgl_t2 {
  .tb {
    height: calc(100% - 2.292vw);
  }
}


.c_img {
  position: absolute;
  width: 50%;
  left: 25%;
  top: 10%;

  img {
    width: 100%;
  }
}


.scgl_t3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;

  .item {
    width: 16.667vw;
    height: 4.635vw;
    background-image: url("../img/p5.svg");
    background-size: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1.042vw;

    .text1 {
      margin-right: 1.042vw;
    }

    .text2 {
      font-size: 2.188vw;
      font-weight: bold;
      color: #0BF9FE;

      small {
        font-size: 0.833vw;
        font-weight: 500;
        color: #fff;
      }
    }

    &.v2 {
      background-image: url("../img/p6.svg");

      .text2 {
        color: #07E96C;
      }
    }
  }
}


.sjtj {
  display: flex;
  justify-content: space-around;
  position: relative;
  z-index: 1;

  .item {
    width: 7.083vw;
    text-align: center;

    .text1 {
      font-size: 1.406vw;
      color: #FFFFFF;
      letter-spacing: 0.052vw;
      font-style: normal;
      text-transform: none;
    }

    .text2 {
      color: rgba(255, 255, 255, 0.7);
      width: 7.083vw;
      line-height: 1.458vw;
      background: linear-gradient(270deg, rgba(0, 0, 0, 0) 0%, #4E3B01 49%, rgba(0, 0, 0, 0) 100%);
      position: relative;
      margin-top: 0.625vw;

      &::after, &::before {
        content: "";
        width: 100%;
        height: 0.052vw;
        background: linear-gradient(90deg, rgba(87, 69, 0, 0) 0%, #FFCB00 49%, rgba(126, 101, 0, 0) 100%);
        position: absolute;
        top: 0;
        left: 0;
      }

      &::before {
        bottom: 0;
        top: auto;
      }
    }

    img {
      width: 5.417vw;
      margin-top: -1.042vw;
    }

    &.v2 {
      margin-top: 3.646vw;

      img {
        width: 6.458vw;
      }

      .text2 {
        background: linear-gradient(270deg, rgba(0, 0, 0, 0.02) 0%, #01434E 49%, rgba(0, 0, 0, 0) 100%);

        &::after, &::before {
          background: linear-gradient(90deg, rgba(0, 46, 87, 0) 0%, #00C2FF 49%, rgba(0, 104, 126, 0) 100%);
        }
      }
    }
  }
}

.sjtj-bg {
  width: 100%;
  margin-top: -100%;
  position: relative;
  top: -3.490vw;
}


.zhaf_t1 {
  padding: 2.083vw 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  box-sizing: border-box;

  .r1 {
    height: 50%;
    position: relative;

    img {
      height: 100%;
      display: block;
    }

    .box {
      position: absolute;
      z-index: 2;
      left: 0;
      right: 0;
      top: 0;
      bottom: 0;
      padding: 1.250vw;

      img {
        width: 100%;
        height: 100%;

      }
    }
  }

  .r2 {
    height: 50%;
    display: flex;
    align-items: flex-end;
    justify-content: center;

    img {
      height: 90%;
      display: block;
    }
  }
}

.zhaf_t2 {
  overflow: auto;
  height: 100%;

  ul {

    li {
      display: flex;
      margin-bottom: 0.625vw;
      position: relative;

      &::before {
        content: "";
        position: absolute;
        left: 0.781vw;
        height: 100%;
        background: #ff0000;
        top: 1.042vw;
        width: 0.052vw;
      }

      &:nth-last-child(1) {
        &::before {
          content: "";
          position: absolute;
          left: 0.781vw;
          height: 0;
          background: #ff0000;
          top: 1.042vw;
          width: 0.052vw;
        }
      }

      .icon1 {
        width: 1.510vw;
        margin-right: 0.625vw;
      }

      .info {
        position: relative;

        .box {
          position: absolute;
          z-index: 2;
          left: 0;
          right: 0;
          top: 0;
          bottom: 0;
          padding: 1.250vw;
          display: flex;
          flex-direction: column;
          justify-content: space-around;

          .btn_box {
            position: absolute;
            right: 1.250vw;
            bottom: 1.250vw;

            button {
              width: 5.521vw;
              height: 1.667vw;
              background: #2F51FF;
              border-radius: 0.208vw 0.208vw 0.208vw 0.208vw;
              display: flex;
              align-items: center;
              justify-content: center;
              border: none;
              color: #fff;
              margin-top: 0.625vw;
              cursor: pointer;

              &:hover {
                background: #4a68ff;
              }
            }
          }
        }
      }
    }
  }
}

.zhaf_t3{
  width: 29.688vw !important;
}

.dp_con {
  position: relative;
  z-index: 9;

  .left.v2 {
    width: 55%;
    padding-right: 0.417vw;
  }

  .right.v2 {
    width: 45%;
    padding-left: 0.417vw;
  }
}

.ydtj_t1 {
  height: 100%;
  display: block;
  width: 100%;
  object-fit: cover;
  padding-bottom: 0.625vw;
  box-sizing: border-box;
}

.ydtj_t2{
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  .item{
    background-image: url("../img/bg6.svg");
    width: 13.333vw;
    height: 5.156vw;
    background-size: cover;
    text-align: center;
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;

    p{
      padding-left: 4.167vw;
      width: 100%;
      box-sizing: border-box;
    }
    .text1{
      font-weight: bold;
      font-size: 1.354vw;
      letter-spacing: 0.104vw;
      background: linear-gradient(180deg, #FFFFFF 0%, #20F14E 100%);
      -webkit-background-clip: text;
      background-clip: text;
      color: transparent;
      margin-bottom: 0.417vw;
    }
    &:nth-child(1),&:nth-child(2),&:nth-child(3){
      margin-bottom: 1.042vw;
      background-image: url("../img/bg5.svg");
      .text1{
        background: linear-gradient(180deg, #FFFFFF 0%, #0BF9FE 100%);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
      }
    }
  }
}

.p-8{
  margin: 0 -0.417vw;
  .w-100{
    padding: 0 0.417vw;
    box-sizing: border-box;
  }
}

.scgl_t4{
  height: calc(60% - 0.625vw);margin-bottom: 0.625vw;padding-top: 2.604vw;box-sizing: border-box
}
.zhaf_h{
  height: calc(50% - 8.646vw - 0.625vw)
}
.ydtj_h{
  height: calc(50% - 8.333vw)
}


</style>



